<!DOCTYPE html>
<!-- saved from url=(0057)https://dev.mysql.com/doc/refman/5.7/en/create-index.html -->
<html lang="en" class="svg js"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <!--[if IE ]>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <![endif]-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="Language" content="en">

    <title>MySQL :: MySQL 5.7 Reference Manual :: 13.1.14 CREATE INDEX Syntax</title>
    <link rel="stylesheet" media="all" href="./28_files/main-20180808.min.css">
            <link rel="stylesheet" media="all" href="./28_files/docs-20180808.min.css">
    
    
    <link rel="stylesheet" media="print" href="./28_files/print-20180808.min.css">

    
    
    
    
            <link rel="contents" href="https://dev.mysql.com/doc/refman/5.7/en/index.html" title="MySQL 5.7 Reference Manual">
<link rel="start" href="https://dev.mysql.com/doc/refman/5.7/en/index.html" title="MySQL 5.7 Reference Manual">
<link rel="prev" href="https://dev.mysql.com/doc/refman/5.7/en/create-function.html" title="13.1.13 CREATE FUNCTION Syntax">
<link rel="next" href="https://dev.mysql.com/doc/refman/5.7/en/create-logfile-group.html?ff=nopfpls" title="13.1.15 CREATE LOGFILE GROUP Syntax">
<link rel="up" href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-definition.html" title="13.1 Data Definition Statements">

    
    <link rel="shortcut icon" href="https://labs.mysql.com/common/themes/sakila/favicon.ico">
    <script>(function(H){ H.className=H.className.replace(/\bno-js\b/,'js') })(document.documentElement)</script>
    <script src="./28_files/site-20180813.min.js"></script>

    
    
    
    <!--[if lt IE 9]>
        <script src="https://labs.mysql.com/common/js/polyfills/html5shiv-printshiv-3.7.2.min.js"></script>
        <script src="https://labs.mysql.com/common/js/polyfills/respond-1.4.2.min.js"></script>
    <![endif]-->
        <!--[if IE 9]>
        <style>#docs-sidebar-toc { box-sizing: content-box; }</style>
    <![endif]-->
    </head>

<body class="no-sidebar full-page dev has-sticky-toc">
<div class="page-wrapper">
    <header>

                        <a href="https://dev.mysql.com/" aria-label="Home" title="MySQL" id="l1-home-link"></a>
        
        <div id="l1-nav-container">
            <div id="l1-line1">
                <div id="l1-auth-links">
                    <a href="https://www.mysql.com/about/contact/"><b>Contact MySQL</b></a>
                    <span id="l1-contact-separator">&nbsp;|&nbsp;</span>
                    <span id="l1-contact-separator-br"><br></span>
                                             <a href="https://dev.mysql.com/auth/login/?dest=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Fcreate-index.html">Login</a> &nbsp;|&nbsp;
                         <a href="https://dev.mysql.com/auth/register/">Register</a>
                                    </div>
                <div id="l1-lhs">
                    <div id="l1-slogan">
                        The world's most popular open source database
                    </div>
                    <div id="l1-search-box">
                        <form id="l1-search-form" method="get" action="https://www.oracle.com/search/results">
                        <input type="hidden" name="cat" value="mysql">
                        <input type="hidden" name="Ntk" value="SI-ALL5">
                        <input id="l1-search-input" type="search" class="icon-search" placeholder="Search" aria-label="Search" name="Ntt">
                        </form>
                    </div>
                </div>
            </div>
            <div id="l1-line2">
                <div class="social-icons">
                    <a aria-label="Join us on Facebook" title="Join us on Facebook" href="http://www.facebook.com/mysql"><span class="icon-facebook"></span></a>
                    <a aria-label="Follow us on Twitter" title="Follow us on Twitter" href="https://twitter.com/mysql"><span class="icon-twitter"></span></a>
                    <a aria-label="Follow us on LinkedIn" title="Follow us on LinkedIn" href="https://www.linkedin.com/company/mysql"><span class="icon-linkedin"></span></a>
                    <a aria-label="Join Google+ to follow MySQL" title="Join Google+ to follow MySQL" href="https://plus.google.com/+mysql"><span class="icon-google-plus"></span></a>
                    <a aria-label="Visit our YouTube channel" title="Visit our YouTube channel" href="http://www.youtube.com/mysqlchannel"><span class="icon-youtube"></span></a>
                </div>
                <ul id="l1-nav">
                    <li>
                        <a href="https://www.mysql.com/"><!-- <span class="icon-sakila"></span>  -->MySQL.com</a>
                    </li><li>
                        <a href="https://www.mysql.com/downloads/"><!-- <span class="icon-download-thin"></span>  -->Downloads</a>
                    </li><li class="active">
                        <a href="https://dev.mysql.com/doc/"><!-- <span class="icon-books"></span>  -->Documentation</a>
                    </li><li>
                        <a href="https://dev.mysql.com/"><!-- <span class="icon-code"></span>  -->Developer Zone</a>
                    </li>                </ul>
            </div>
        </div>
        <div id="sub-header">
            <div id="l2-nav-container">
                <div id="l2-nav-toggle">
                    <span class="icon-three-bars"></span>
                </div>
                                                                                        <a class="button nav-button-3" href="https://dev.mysql.com/"><span class="icon-code"></span> Developer Zone</a>
                                                                                                                                    <a class="button nav-button-2" href="https://www.mysql.com/downloads/"><span class="icon-download-thin"></span> Downloads</a>
                                                                                                <a class="button nav-button-1" href="https://www.mysql.com/"><span class="icon-sakila"></span> MySQL.com</a>
                                                                        <div id="l2-search-toggle">
                    <span class="icon-search"></span>
                </div>
                <div id="l2-site-icon">
                                                                                                                                                                                                    <span class="icon-books"></span>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </div>
                <div id="l1-section-title">
                    <span id="l1-section-label">
                        <a href="https://dev.mysql.com/doc/">Documentation</a>
                    </span>
                </div>
                <nav>
                    

<ul id="l2-nav">
            	<li class="active"><a class="active " href="https://dev.mysql.com/doc/refman/en/">MySQL Server</a>
    			</li>
	        	<li class=""><a href="https://dev.mysql.com/doc/index-enterprise.html">MySQL Enterprise</a>
    			</li>
	        	<li class=""><a href="https://dev.mysql.com/doc/workbench/en/">Workbench</a>
    			</li>
	        	<li class=""><a href="https://dev.mysql.com/doc/en/mysql-innodb-cluster-userguide.html">InnoDB Cluster</a>
    			</li>
	        	<li class=""><a href="https://dev.mysql.com/doc/index-cluster.html">MySQL NDB Cluster</a>
    			</li>
	        	<li class=""><a href="https://dev.mysql.com/doc/index-connectors.html">Connectors</a>
    			</li>
	        	<li class=" last"><a href="https://dev.mysql.com/doc/index-other.html">More</a>
    			</li>
	                        <li class="other-section"><a href="https://www.mysql.com/">MySQL.com</a></li>
                            <li class="other-section"><a href="https://www.mysql.com/downloads/">Downloads</a></li>
                                        <li class="other-section"><a href="https://dev.mysql.com/">Developer Zone</a></li>
            </ul>
                </nav>
            </div>
            <div id="l3-search-container"></div>
            <div id="top-orange"><span id="section-nav">Section Menu: &nbsp; </span></div>
        </div>
    </header>
    <div id="page">
                        <div role="main" id="main">

            
                
            
<div>
    <div id="docs-sidebar-toc" class="sticky" style="max-height: 509px; overflow-y: auto;">
    <div id="docs-toc-inner">
        <div class="docs-sidebar-header" id="docs-nav-header">
            <a class="docs-show-hide-nav" id="docs-hide-nav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" title="Hide Sidebar" aria-label="Hide Sidebar"><span class="icon-arrow-small-left"></span></a>
            <div class="docs-nav-links">
                                    
    <a href="https://dev.mysql.com/doc/refman/5.7/en/create-function.html" aria-label="Previous" title="Previous: CREATE FUNCTION Syntax"><span class="icon-chevron-left"></span></a>
<a href="https://dev.mysql.com/doc/refman/5.7/en/index.html" aria-label="Start" title="Start"><span class="icon-book-open"></span></a>
        <a aria-label="Up" href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-definition.html" title="Up: Data Definition Statements"><span class="icon-chevron-up"></span></a>
    <a href="https://dev.mysql.com/doc/refman/5.7/en/create-logfile-group.html" aria-label="Next" title="Next: CREATE LOGFILE GROUP Syntax"><span class="icon-chevron-right"></span></a>
                            </div>
        </div>
                    
<div id="docs-sidebar-search-container">
    <div id="docs-sidebar-search-box">
        <form method="get" action="https://dev.mysql.com/doc/search/">
            <input type="hidden" name="d" id="d" value="12">
            <input type="hidden" name="p" id="p" value="1">
            <input type="text" name="q" id="q" title="Search this Manual" value="Search this Manual" style="color: #bbb;" onfocus="if(this.value == &#39;Search this Manual&#39;) {this.value=&#39;&#39;;this.style.color=&#39;#555&#39;;}" onblur="if(this.value == &#39;&#39;) {this.value=&#39;Search this Manual&#39;;this.style.color=&#39;#bbb&#39;;}">

            <button class="docs-sidebar-search-btn" aria-label="Search" title="Search" type="submit">
                <span class="icon-search"></span>
            </button>
        </form>
    </div>
</div>
                <div class="docs-sidebar-nav">
            <a class="docs-icon-home" href="https://dev.mysql.com/doc/"><span class="icon-home"></span>Documentation Home</a><hr>
            <div class="docs-sidebar-mtitle">MySQL 5.7 Reference Manual</div>
            <nav class="doctoc" id="doc-12">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/preface.html">Preface and Legal Notices</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/introduction.html">General Information</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/installing.html">Installing and Upgrading MySQL</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/tutorial.html">Tutorial</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/programs.html">MySQL Programs</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/server-administration.html">MySQL Server Administration</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/security.html">Security</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/backup-and-recovery.html">Backup and Recovery</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/optimization.html">Optimization</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/language-structure.html">Language Structure</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/charset.html">Character Sets, Collations, Unicode</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/data-types.html">Data Types</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/functions.html">Functions and Operators</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-down"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax.html">SQL Statement Syntax</a></div></div>                        <div class="docs-submenu">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-down"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-definition.html">Data Definition Statements</a></div></div>                        <div class="docs-submenu">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-database.html">ALTER DATABASE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-event.html">ALTER EVENT Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-function.html">ALTER FUNCTION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-instance.html">ALTER INSTANCE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-logfile-group.html">ALTER LOGFILE GROUP Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-procedure.html">ALTER PROCEDURE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-server.html">ALTER SERVER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-table.html">ALTER TABLE Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-table-partition-operations.html">ALTER TABLE Partition Operations</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-table-online-operations.html">ALTER TABLE Online Operations in NDB Cluster</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-table-generated-columns.html">ALTER TABLE and Generated Columns</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-table-examples.html">ALTER TABLE Examples</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-tablespace.html">ALTER TABLESPACE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-view.html">ALTER VIEW Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-database.html">CREATE DATABASE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-event.html">CREATE EVENT Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-function.html">CREATE FUNCTION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link current"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html">CREATE INDEX Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-logfile-group.html">CREATE LOGFILE GROUP Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-procedure.html">CREATE PROCEDURE and CREATE FUNCTION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-server.html">CREATE SERVER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table.html">CREATE TABLE Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table-statement-retention.html">CREATE TABLE Statement Retention</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table-files.html">Files Created by CREATE TABLE</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-temporary-table.html">CREATE TEMPORARY TABLE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table-like.html">CREATE TABLE ... LIKE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table-select.html">CREATE TABLE ... SELECT Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html">Using FOREIGN KEY Constraints</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/silent-column-changes.html">Silent Column Specification Changes</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html">CREATE TABLE and Generated Columns</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table-secondary-indexes.html">Secondary Indexes and Generated Columns</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table-ndb-table-comment-options.html">Setting NDB_TABLE Options</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html">CREATE TABLESPACE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-trigger.html">CREATE TRIGGER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-view.html">CREATE VIEW Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-database.html">DROP DATABASE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-event.html">DROP EVENT Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-function.html">DROP FUNCTION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-index.html">DROP INDEX Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-logfile-group.html">DROP LOGFILE GROUP Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-procedure.html">DROP PROCEDURE and DROP FUNCTION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-server.html">DROP SERVER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-table.html">DROP TABLE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-tablespace.html">DROP TABLESPACE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-trigger.html">DROP TRIGGER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-view.html">DROP VIEW Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/rename-table.html">RENAME TABLE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/truncate-table.html">TRUNCATE TABLE Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-manipulation.html">Data Manipulation Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/call.html">CALL Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/delete.html">DELETE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/do.html">DO Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/handler.html">HANDLER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/insert.html">INSERT Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/insert-select.html">INSERT ... SELECT Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html">INSERT ... ON DUPLICATE KEY UPDATE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/insert-delayed.html">INSERT DELAYED Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/load-data.html">LOAD DATA INFILE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/load-xml.html">LOAD XML Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/replace.html">REPLACE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/select.html">SELECT Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/select-into.html">SELECT ... INTO Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/join.html">JOIN Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/union.html">UNION Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/subqueries.html">Subquery Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/scalar-subqueries.html">The Subquery as Scalar Operand</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/comparisons-using-subqueries.html">Comparisons Using Subqueries</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/any-in-some-subqueries.html">Subqueries with ANY, IN, or SOME</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/all-subqueries.html">Subqueries with ALL</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/row-subqueries.html">Row Subqueries</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/exists-and-not-exists-subqueries.html">Subqueries with EXISTS or NOT EXISTS</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/correlated-subqueries.html">Correlated Subqueries</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/derived-tables.html">Derived Tables</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/subquery-errors.html">Subquery Errors</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/optimizing-subqueries.html">Optimizing Subqueries</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/rewriting-subqueries.html">Rewriting Subqueries as Joins</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/update.html">UPDATE Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-transactions.html">Transactional and Locking Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/commit.html">START TRANSACTION, COMMIT, and ROLLBACK Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/cannot-roll-back.html">Statements That Cannot Be Rolled Back</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html">Statements That Cause an Implicit Commit</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/savepoint.html">SAVEPOINT, ROLLBACK TO SAVEPOINT, and RELEASE SAVEPOINT Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/lock-tables.html">LOCK TABLES and UNLOCK TABLES Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/lock-tables-and-transactions.html">Interaction of Table Locking and Transactions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/lock-tables-and-triggers.html">LOCK TABLES and Triggers</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/lock-tables-restrictions.html">Table-Locking Restrictions and Conditions</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/set-transaction.html">SET TRANSACTION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/xa.html">XA Transactions</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/xa-statements.html">XA Transaction SQL Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/xa-states.html">XA Transaction States</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-replication.html">Replication Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/replication-master-sql.html">SQL Statements for Controlling Master Servers</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/purge-binary-logs.html">PURGE BINARY LOGS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/reset-master.html">RESET MASTER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/set-sql-log-bin.html">SET sql_log_bin Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/replication-slave-sql.html">SQL Statements for Controlling Slave Servers</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/change-master-to.html">CHANGE MASTER TO Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html">CHANGE REPLICATION FILTER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/master-pos-wait.html">MASTER_POS_WAIT() Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/reset-slave.html">RESET SLAVE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/set-global-sql-slave-skip-counter.html">SET GLOBAL sql_slave_skip_counter Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/start-slave.html">START SLAVE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/stop-slave.html">STOP SLAVE Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/replication-group-sql.html">SQL Statements for Controlling Group Replication</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/start-group-replication.html">START GROUP_REPLICATION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/stop-group-replication.html">STOP GROUP_REPLICATION Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.html">Prepared SQL Statement Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/prepare.html">PREPARE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/execute.html">EXECUTE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/deallocate-prepare.html">DEALLOCATE PREPARE Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-compound-statements.html">Compound-Statement Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/begin-end.html">BEGIN ... END Compound-Statement Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/statement-labels.html">Statement Label Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/declare.html">DECLARE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/stored-program-variables.html">Variables in Stored Programs</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/declare-local-variable.html">Local Variable DECLARE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/local-variable-scope.html">Local Variable Scope and Resolution</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/flow-control-statements.html">Flow Control Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/case.html">CASE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/if.html">IF Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/iterate.html">ITERATE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/leave.html">LEAVE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/loop.html">LOOP Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/repeat.html">REPEAT Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/return.html">RETURN Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/while.html">WHILE Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/cursors.html">Cursors</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/close.html">Cursor CLOSE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/declare-cursor.html">Cursor DECLARE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/fetch.html">Cursor FETCH Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/open.html">Cursor OPEN Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/condition-handling.html">Condition Handling</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/declare-condition.html">DECLARE ... CONDITION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/declare-handler.html">DECLARE ... HANDLER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/get-diagnostics.html">GET DIAGNOSTICS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/resignal.html">RESIGNAL Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/signal.html">SIGNAL Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/handler-scope.html">Scope Rules for Handlers</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/diagnostics-area.html">The MySQL Diagnostics Area</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-server-administration.html">Database Administration Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/account-management-sql.html">Account Management Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/alter-user.html">ALTER USER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-user.html">CREATE USER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-user.html">DROP USER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/grant.html">GRANT Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/rename-user.html">RENAME USER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/revoke.html">REVOKE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/set-password.html">SET PASSWORD Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/table-maintenance-sql.html">Table Maintenance Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/analyze-table.html">ANALYZE TABLE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/check-table.html">CHECK TABLE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/checksum-table.html">CHECKSUM TABLE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/optimize-table.html">OPTIMIZE TABLE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/repair-table.html">REPAIR TABLE Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/component-sql.html">Plugin and User-Defined Function Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-function-udf.html">CREATE FUNCTION Syntax for User-Defined Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/drop-function-udf.html">DROP FUNCTION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/install-plugin.html">INSTALL PLUGIN Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/uninstall-plugin.html">UNINSTALL PLUGIN Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/set-statement.html">SET Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/set-variable.html">SET Syntax for Variable Assignment</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/set-character-set.html">SET CHARACTER SET Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/set-names.html">SET NAMES Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show.html">SHOW Syntax</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-binary-logs.html">SHOW BINARY LOGS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-binlog-events.html">SHOW BINLOG EVENTS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-character-set.html">SHOW CHARACTER SET Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-collation.html">SHOW COLLATION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-columns.html">SHOW COLUMNS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-create-database.html">SHOW CREATE DATABASE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-create-event.html">SHOW CREATE EVENT Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-create-function.html">SHOW CREATE FUNCTION Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-create-procedure.html">SHOW CREATE PROCEDURE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-create-table.html">SHOW CREATE TABLE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-create-trigger.html">SHOW CREATE TRIGGER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-create-user.html">SHOW CREATE USER Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-create-view.html">SHOW CREATE VIEW Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-databases.html">SHOW DATABASES Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-engine.html">SHOW ENGINE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-engines.html">SHOW ENGINES Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-errors.html">SHOW ERRORS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-events.html">SHOW EVENTS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-function-code.html">SHOW FUNCTION CODE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-function-status.html">SHOW FUNCTION STATUS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-grants.html">SHOW GRANTS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-index.html">SHOW INDEX Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-master-status.html">SHOW MASTER STATUS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-open-tables.html">SHOW OPEN TABLES Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-plugins.html">SHOW PLUGINS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-privileges.html">SHOW PRIVILEGES Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-procedure-code.html">SHOW PROCEDURE CODE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-procedure-status.html">SHOW PROCEDURE STATUS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-processlist.html">SHOW PROCESSLIST Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-profile.html">SHOW PROFILE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-profiles.html">SHOW PROFILES Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-relaylog-events.html">SHOW RELAYLOG EVENTS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-slave-hosts.html">SHOW SLAVE HOSTS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-slave-status.html">SHOW SLAVE STATUS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-status.html">SHOW STATUS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-table-status.html">SHOW TABLE STATUS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-tables.html">SHOW TABLES Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-triggers.html">SHOW TRIGGERS Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-variables.html">SHOW VARIABLES Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/show-warnings.html">SHOW WARNINGS Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/other-administrative-sql.html">Other Administrative Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/binlog.html">BINLOG Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/cache-index.html">CACHE INDEX Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/flush.html">FLUSH Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/kill.html">KILL Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/load-index.html">LOAD INDEX INTO CACHE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/reset.html">RESET Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/shutdown.html">SHUTDOWN Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-utility.html">Utility Statements</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/describe.html">DESCRIBE Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/explain.html">EXPLAIN Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/help.html">HELP Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/use.html">USE Syntax</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html">The InnoDB Storage Engine</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/storage-engines.html">Alternative Storage Engines</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/replication.html">Replication</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/group-replication.html">Group Replication</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-userguide.html">MySQL Shell</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/document-store.html">Using MySQL as a Document Store</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/mysql-innodb-cluster-userguide.html">InnoDB Cluster</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html">MySQL NDB Cluster 7.5 and NDB Cluster 7.6</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/partitioning.html">Partitioning</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/stored-programs-views.html">Stored Programs and Views</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/information-schema.html">INFORMATION_SCHEMA Tables</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/performance-schema.html">MySQL Performance Schema</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/sys-schema.html">MySQL sys Schema</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/connectors-apis.html">Connectors and APIs</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/extending-mysql.html">Extending MySQL</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/mysql-enterprise.html">MySQL Enterprise Edition</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/workbench.html">MySQL Workbench</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/faqs.html">MySQL 5.7 Frequently Asked Questions</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/error-handling.html">Errors, Error Codes, and Common Problems</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/restrictions.html">Restrictions and Limits</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/indexes.html">Indexes</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/glossary.html">MySQL Glossary</a></div></div>                    </li>
        </ul>
                            </nav>
        </div>

        
<a class="docs-sidebar-section" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-related"></span>
    <span class="text">Related Documentation</span></a>
<div class="docs-sidebar-accordian open">
    <div class="text">
        <a href="https://dev.mysql.com/doc/relnotes/mysql/5.7/en/">MySQL 5.7 Release Notes</a><br>
        </div>
</div>

    <a class="docs-sidebar-section" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-download-thin"></span>
        <span class="text">
            Download
                            this Manual
                    </span>
    </a>
    <div class="docs-sidebar-accordian open">
        <div class="text">
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.pdf">PDF (US Ltr)</a>
            - 38.9Mb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.a4.pdf">PDF (A4)</a>
            - 39.0Mb<br>
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-5.7-en-pdf-1-20181013.noarch.rpm">PDF (RPM)</a>
            - 38.0Mb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.html-chapter.tar.gz">HTML Download (TGZ)</a>
            - 10.8Mb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.html-chapter.zip">HTML Download (Zip)</a>
            - 10.8Mb<br>
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-5.7-en-html-chapter-1-20181013.noarch.rpm">HTML Download (RPM)</a>
            - 9.5Mb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.man-gpl.tar.gz">Man Pages (TGZ)</a>
            - 211.0Kb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.man-gpl.zip">Man Pages (Zip)</a>
            - 320.0Kb<br>
                        <a href="https://downloads.mysql.com/docs/mysql-5.7.info.gz">Info (Gzip)</a>
            - 3.5Mb<br>
                        <a href="https://downloads.mysql.com/docs/mysql-5.7.info.zip">Info (Zip)</a>
            - 3.5Mb<br>
                    </div>
    </div>

<a class="docs-sidebar-section" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-book"></span>
    <span class="text">Excerpts from this Manual</span></a>
<div class="docs-sidebar-accordian">
    <div class="text">
                <a href="https://dev.mysql.com/doc/mysql-backup-excerpt/5.7/en/">MySQL Backup and Recovery</a><br>
                <a href="https://dev.mysql.com/doc/mysql-g11n-excerpt/5.7/en/">MySQL Globalization</a><br>
                <a href="https://dev.mysql.com/doc/mysql-infoschema-excerpt/5.7/en/">MySQL Information Schema</a><br>
                <a href="https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/">MySQL Installation Guide</a><br>
                <a href="https://dev.mysql.com/doc/mysql-linuxunix-excerpt/5.7/en/">MySQL and Linux/Unix</a><br>
                <a href="https://dev.mysql.com/doc/mysql-osx-excerpt/5.7/en/">MySQL and OS X</a><br>
                <a href="https://dev.mysql.com/doc/mysql-partitioning-excerpt/5.7/en/">MySQL Partitioning</a><br>
                <a href="https://dev.mysql.com/doc/mysql-perfschema-excerpt/5.7/en/">MySQL Performance Schema</a><br>
                <a href="https://dev.mysql.com/doc/mysql-replication-excerpt/5.7/en/">MySQL Replication</a><br>
                <a href="https://dev.mysql.com/doc/mysql-repo-excerpt/5.7/en/">Using the MySQL Yum Repository</a><br>
                <a href="https://dev.mysql.com/doc/mysql-reslimits-excerpt/5.7/en/">MySQL Restrictions and Limitations</a><br>
                <a href="https://dev.mysql.com/doc/mysql-security-excerpt/5.7/en/">Security in MySQL</a><br>
                <a href="https://dev.mysql.com/doc/mysql-solaris-excerpt/5.7/en/">MySQL and Solaris</a><br>
                <a href="https://dev.mysql.com/doc/mysql-sourcebuild-excerpt/5.7/en/">Building MySQL from Source</a><br>
                <a href="https://dev.mysql.com/doc/mysql-startstop-excerpt/5.7/en/">Starting and Stopping MySQL</a><br>
                <a href="https://dev.mysql.com/doc/mysql-tutorial-excerpt/5.7/en/">MySQL Tutorial</a><br>
                <a href="https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/">MySQL and Windows</a><br>
                <a href="https://dev.mysql.com/doc/mysql-cluster-excerpt/5.7/en/">MySQL NDB Cluster 7.5</a><br>
                <a href="https://dev.mysql.com/doc/mysql-secure-deployment-guide/5.7/en/">MySQL Secure Deployment Guide</a><br>
            </div>
</div>

        <br><span id="wkr" style="display: inline-block;"><br></span>
    </div>
    </div>

    <div id="docs-main" class="has-toc">
    <div id="docs-main-inner">

                <div class="right" id="docs-version-nav">
            <a href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" id="docs-version-nav-toggle">version 5.7
            <span class="icon-chevron-down"></span></a>
            <div id="docs-version-list">
                                                        <a href="https://dev.mysql.com/doc/refman/8.0/en/create-index.html">
                        8.0
                                                &nbsp;current
                                            </a><br>
                                                                                                                <a href="https://dev.mysql.com/doc/refman/5.6/en/create-index.html">
                        5.6
                                            </a><br>
                                                                            <a href="https://dev.mysql.com/doc/refman/5.5/en/create-index.html">
                        5.5
                                            </a><br>
                                                                        <div id="docs-version-nav-lang">
                                                                                                                                                    <a href="https://dev.mysql.com/doc/refman/5.6/ja/create-index.html">
                                    5.6&nbsp;
                                                                            Japanese
                                                                    </a><br>
                                                                                            </div>
                            </div>
        </div>
        
        <div id="docs-show-nav" class="left hidden" style="margin-right: 15px;">
            <a class="docs-show-hide-nav" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" aria-label="Show Sidebar" title="Show Sidebar"><span class="icon-arrow-small-right"></span></a>
        </div>

                        <div id="docs-breadcrumbs">
            <a href="https://dev.mysql.com/doc/refman/5.7/en/">MySQL 5.7 Reference Manual</a> &nbsp;/&nbsp;
                            <span id="breadcrumbs-link"><a href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" id="show-breadcrumbs">...</a> &nbsp;/&nbsp;</span>
                <span class="hidden" id="hidden-breadcrumbs">
                                                        <a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax.html">SQL Statement Syntax</a> &nbsp;/&nbsp;
                                                            <a href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-definition.html">Data Definition Statements</a> &nbsp;/&nbsp;
                                                                                        </span>
                                        CREATE INDEX Syntax
                                    </div>
        
        <div id="docs-body">
        
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="create-index"></a>13.1.14&nbsp;CREATE INDEX Syntax</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139976444284400"></a><a class="indexterm" name="idm139976444283328"></a><a class="indexterm" name="idm139976444282256"></a><a class="indexterm" name="idm139976444280768"></a><div class="copytoclipboard-wrapper" style="position: relative;"><pre class="programlisting line-numbers  language-sql"><div class="docs-select-all right" id="sa27585991" style="display: none;"><div class="copy-help left" style="display: none;">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class=" language-sql"><span class="token keyword">CREATE</span> <span class="token punctuation">[</span><span class="token keyword">UNIQUE</span> <span class="token operator">|</span> <span class="token keyword">FULLTEXT</span> <span class="token operator">|</span> <span class="token keyword">SPATIAL</span><span class="token punctuation">]</span> <span class="token keyword">INDEX</span> <em class="replaceable">index_name</em>
    <span class="token punctuation">[</span><em class="replaceable">index_type</em><span class="token punctuation">]</span>
    <span class="token keyword">ON</span> <em class="replaceable">tbl_name</em> <span class="token punctuation">(</span><em class="replaceable">key_part</em><span class="token punctuation">,</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span>
    <span class="token punctuation">[</span><em class="replaceable">index_option</em><span class="token punctuation">]</span>
    <span class="token punctuation">[</span><em class="replaceable">algorithm_option</em> <span class="token operator">|</span> <em class="replaceable">lock_option</em><span class="token punctuation">]</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>

<em class="replaceable">key_part</em>:
    <em class="replaceable">col_name</em> <span class="token punctuation">[</span><span class="token punctuation">(</span><em class="replaceable">length</em><span class="token punctuation">)</span><span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token keyword">ASC</span> <span class="token operator">|</span> <span class="token keyword">DESC</span><span class="token punctuation">]</span>

<em class="replaceable">index_option</em>:
    <span class="token keyword">KEY_BLOCK_SIZE</span> <span class="token punctuation">[</span><span class="token operator">=</span><span class="token punctuation">]</span> <span class="token keyword"><em class="replaceable">value</em></span>
  <span class="token operator">|</span> <em class="replaceable">index_type</em>
  <span class="token operator">|</span> <span class="token keyword">WITH</span> <span class="token keyword">PARSER</span> <em class="replaceable">parser_name</em>
  <span class="token operator">|</span> <span class="token keyword">COMMENT</span> <span class="token string">'<em class="replaceable">string</em>'</span>

<em class="replaceable">index_type</em>:
    <span class="token keyword">USING</span> {<span class="token keyword">BTREE</span> <span class="token operator">|</span> <span class="token keyword">HASH</span>}

<em class="replaceable">algorithm_option</em>:
    <span class="token keyword">ALGORITHM</span> <span class="token punctuation">[</span><span class="token operator">=</span><span class="token punctuation">]</span> {<span class="token keyword">DEFAULT</span> <span class="token operator">|</span> INPLACE <span class="token operator">|</span> COPY}

<em class="replaceable">lock_option</em>:
    <span class="token keyword">LOCK</span> <span class="token punctuation">[</span><span class="token operator">=</span><span class="token punctuation">]</span> {<span class="token keyword">DEFAULT</span> <span class="token operator">|</span> <span class="token keyword">NONE</span> <span class="token operator">|</span> SHARED <span class="token operator">|</span> EXCLUSIVE}<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></div><p>
      Normally, you create all indexes on a table at the time the table
      itself is created with <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-table.html" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE
      TABLE</code></a>. See <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-table.html" title="13.1.18 CREATE TABLE Syntax">Section&nbsp;13.1.18, “CREATE TABLE Syntax”</a>. This
      guideline is especially important for
      <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> tables, where the primary key
      determines the physical layout of rows in the data file.
      <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" title="13.1.14 CREATE INDEX Syntax"><code class="literal">CREATE INDEX</code></a> enables you to add
      indexes to existing tables.
    </p><p>
      <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" title="13.1.14 CREATE INDEX Syntax"><code class="literal">CREATE INDEX</code></a> is mapped to an
      <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/alter-table.html" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a> statement to create
      indexes. See <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/alter-table.html" title="13.1.8 ALTER TABLE Syntax">Section&nbsp;13.1.8, “ALTER TABLE Syntax”</a>.
      <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" title="13.1.14 CREATE INDEX Syntax"><code class="literal">CREATE INDEX</code></a> cannot be used to
      create a <code class="literal">PRIMARY KEY</code>; use
      <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/alter-table.html" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a> instead. For more
      information about indexes, see <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/mysql-indexes.html" title="8.3.1 How MySQL Uses Indexes">Section&nbsp;8.3.1, “How MySQL Uses Indexes”</a>.
    </p><p>
      <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> supports secondary indexes on
      virtual columns. For more information, see
      <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-table-secondary-indexes.html" title="13.1.18.9 Secondary Indexes and Generated Columns">Section&nbsp;13.1.18.9, “Secondary Indexes and Generated Columns”</a>.
    </p><p>
      When the <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_stats_persistent"><code class="literal">innodb_stats_persistent</code></a>
      setting is enabled, run the <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/analyze-table.html" title="13.7.2.1 ANALYZE TABLE Syntax"><code class="literal">ANALYZE
      TABLE</code></a> statement for an
      <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> table after creating an index
      on that table.
    </p><p>
      An index specification of the form
      <code class="literal">(<em class="replaceable"><code>key_part1</code></em>,
      <em class="replaceable"><code>key_part2</code></em>, ...)</code> creates an
      index with multiple key parts. Index key values are formed by
      concatenating the values of the given key parts. For example
      <code class="literal">(col1, col2, col3)</code> specifies a multiple-column
      index with index keys consisting of values from
      <code class="literal">col1</code>, <code class="literal">col2</code>, and
      <code class="literal">col3</code>.
    </p><p>
      A <em class="replaceable"><code>key_part</code></em> specification can end with
      <code class="literal">ASC</code> or <code class="literal">DESC</code>. These keywords
      are permitted for future extensions for specifying ascending or
      descending index value storage. Currently, they are parsed but
      ignored; index values are always stored in ascending order.
    </p><p>
      The following sections describe different aspects of the
      <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" title="13.1.14 CREATE INDEX Syntax"><code class="literal">CREATE INDEX</code></a> statement:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html#create-index-column-prefixes" title="Column Prefix Key Parts">Column Prefix Key Parts</a></p></li><li class="listitem"><p><a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html#create-index-unique" title="Unique Indexes">Unique Indexes</a></p></li><li class="listitem"><p><a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html#create-index-fulltext" title="Full-Text Indexes">Full-Text Indexes</a></p></li><li class="listitem"><p><a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html#create-index-spatial" title="Spatial Indexes">Spatial Indexes</a></p></li><li class="listitem"><p><a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html#create-index-options" title="Index Options">Index Options</a></p></li><li class="listitem"><p><a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html#create-index-copying" title="Table Copying and Locking Options">Table Copying and Locking Options</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h4 class="title"><a name="create-index-column-prefixes"></a>Column Prefix Key Parts</h4>

</div>

</div>

</div>
<p>
        For string columns, indexes can be created that use only the
        leading part of column values, using
        <code class="literal"><em class="replaceable"><code>col_name</code></em>(<em class="replaceable"><code>length</code></em>)</code>
        syntax to specify an index prefix length:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Prefixes can be specified for
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/char.html" title="11.4.1 The CHAR and VARCHAR Types"><code class="literal">CHAR</code></a>,
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/char.html" title="11.4.1 The CHAR and VARCHAR Types"><code class="literal">VARCHAR</code></a>,
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html" title="11.4.2 The BINARY and VARBINARY Types"><code class="literal">BINARY</code></a>, and
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html" title="11.4.2 The BINARY and VARBINARY Types"><code class="literal">VARBINARY</code></a> key parts.
          </p></li><li class="listitem"><p>
            Prefixes <span class="emphasis"><em>must</em></span> be specified for
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/blob.html" title="11.4.3 The BLOB and TEXT Types"><code class="literal">BLOB</code></a> and
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/blob.html" title="11.4.3 The BLOB and TEXT Types"><code class="literal">TEXT</code></a> key parts. Additionally,
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/blob.html" title="11.4.3 The BLOB and TEXT Types"><code class="literal">BLOB</code></a> and
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/blob.html" title="11.4.3 The BLOB and TEXT Types"><code class="literal">TEXT</code></a> columns can be indexed
            only for <code class="literal">InnoDB</code>,
            <code class="literal">MyISAM</code>, and <code class="literal">BLACKHOLE</code>
            tables.
          </p><a class="indexterm" name="idm139976444215152"></a><a class="indexterm" name="idm139976444213664"></a><a class="indexterm" name="idm139976444212176"></a><a class="indexterm" name="idm139976444210688"></a></li><li class="listitem"><p>
            Prefix <span class="emphasis"><em>limits</em></span> are measured in bytes.
            However, prefix <span class="emphasis"><em>lengths</em></span> for index
            specifications in <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-table.html" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE
            TABLE</code></a>, <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/alter-table.html" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a>,
            and <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" title="13.1.14 CREATE INDEX Syntax"><code class="literal">CREATE INDEX</code></a> statements
            are interpreted as number of characters for nonbinary string
            types (<a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/char.html" title="11.4.1 The CHAR and VARCHAR Types"><code class="literal">CHAR</code></a>,
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/char.html" title="11.4.1 The CHAR and VARCHAR Types"><code class="literal">VARCHAR</code></a>,
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/blob.html" title="11.4.3 The BLOB and TEXT Types"><code class="literal">TEXT</code></a>) and number of bytes for
            binary string types (<a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html" title="11.4.2 The BINARY and VARBINARY Types"><code class="literal">BINARY</code></a>,
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html" title="11.4.2 The BINARY and VARBINARY Types"><code class="literal">VARBINARY</code></a>,
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/blob.html" title="11.4.3 The BLOB and TEXT Types"><code class="literal">BLOB</code></a>). Take this into account
            when specifying a prefix length for a nonbinary string
            column that uses a multibyte character set.
          </p><p>
            Prefix support and lengths of prefixes (where supported) are
            storage engine dependent. For example, a prefix can be up to
            767 bytes long for <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a>
            tables or 3072 bytes if the
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix"><code class="literal">innodb_large_prefix</code></a> option
            is enabled. For <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html" title="15.2 The MyISAM Storage Engine"><code class="literal">MyISAM</code></a> tables,
            the prefix length limit is 1000 bytes. The
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> storage engine does not
            support prefixes (see
            <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-limitations-unsupported.html" title="21.1.6.6 Unsupported or Missing Features in NDB Cluster">Section&nbsp;21.1.6.6, “Unsupported or Missing Features in NDB Cluster”</a>).
</p></li></ul>
</div>
<p>
        As of MySQL 5.7.17, if a specified index prefix exceeds the
        maximum column data type size, <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" title="13.1.14 CREATE INDEX Syntax"><code class="literal">CREATE
        INDEX</code></a> handles the index as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            For a nonunique index, either an error occurs (if strict SQL
            mode is enabled), or the index length is reduced to lie
            within the maximum column data type size and a warning is
            produced (if strict SQL mode is not enabled).
          </p></li><li class="listitem"><p>
            For a unique index, an error occurs regardless of SQL mode
            because reducing the index length might enable insertion of
            nonunique entries that do not meet the specified uniqueness
            requirement.
</p></li></ul>
</div>
<p>
        The statement shown here creates an index using the first 10
        characters of the <code class="literal">name</code> column (assuming that
        <code class="literal">name</code> has a nonbinary string type):
      </p><div class="copytoclipboard-wrapper" style="position: relative;"><pre class="programlisting line-numbers one-line language-sql"><div class="docs-select-all right" id="sa57509144" style="display: none;"><div class="copy-help left" style="display: none;">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class=" language-sql"><span class="token keyword">CREATE</span> <span class="token keyword">INDEX</span> part_of_name <span class="token keyword">ON</span> customer <span class="token punctuation">(</span><span class="token keyword">name</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></div><p>
        If names in the column usually differ in the first 10
        characters, lookups performed using this index should not be
        much slower than using an index created from the entire
        <code class="literal">name</code> column. Also, using column prefixes for
        indexes can make the index file much smaller, which could save a
        lot of disk space and might also speed up
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/insert.html" title="13.2.5 INSERT Syntax"><code class="literal">INSERT</code></a> operations.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="create-index-unique"></a>Unique Indexes</h4>

</div>

</div>

</div>
<p>
        A <code class="literal">UNIQUE</code> index creates a constraint such that
        all values in the index must be distinct. An error occurs if you
        try to add a new row with a key value that matches an existing
        row. If you specify a prefix value for a column in a
        <code class="literal">UNIQUE</code> index, the column values must be
        unique within the prefix length. A <code class="literal">UNIQUE</code>
        index permits multiple <code class="literal">NULL</code> values for
        columns that can contain <code class="literal">NULL</code>.
      </p><a class="indexterm" name="idm139976444173840"></a><p>
        If a table has a <code class="literal">PRIMARY KEY</code> or
        <code class="literal">UNIQUE NOT NULL</code> index that consists of a
        single column that has an integer type, you can use
        <code class="literal">_rowid</code> to refer to the indexed column in
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/select.html" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a> statements, as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">_rowid</code> refers to the <code class="literal">PRIMARY
            KEY</code> column if there is a <code class="literal">PRIMARY
            KEY</code> consisting of a single integer column. If
            there is a <code class="literal">PRIMARY KEY</code> but it does not
            consist of a single integer column,
            <code class="literal">_rowid</code> cannot be used.
          </p></li><li class="listitem"><p>
            Otherwise, <code class="literal">_rowid</code> refers to the column in
            the first <code class="literal">UNIQUE NOT NULL</code> index if that
            index consists of a single integer column. If the first
            <code class="literal">UNIQUE NOT NULL</code> index does not consist of
            a single integer column, <code class="literal">_rowid</code> cannot be
            used.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="create-index-fulltext"></a>Full-Text Indexes</h4>

</div>

</div>

</div>
<p>
        <code class="literal">FULLTEXT</code> indexes are supported only for
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> and
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html" title="15.2 The MyISAM Storage Engine"><code class="literal">MyISAM</code></a> tables and can include only
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/char.html" title="11.4.1 The CHAR and VARCHAR Types"><code class="literal">CHAR</code></a>,
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/char.html" title="11.4.1 The CHAR and VARCHAR Types"><code class="literal">VARCHAR</code></a>, and
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/blob.html" title="11.4.3 The BLOB and TEXT Types"><code class="literal">TEXT</code></a> columns. Indexing always
        happens over the entire column; column prefix indexing is not
        supported and any prefix length is ignored if specified. See
        <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/fulltext-search.html" title="12.9 Full-Text Search Functions">Section&nbsp;12.9, “Full-Text Search Functions”</a>, for details of operation.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="create-index-spatial"></a>Spatial Indexes</h4>

</div>

</div>

</div>
<p>
        The <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html" title="15.2 The MyISAM Storage Engine"><code class="literal">MyISAM</code></a>,
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a>,
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a>, and
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/archive-storage-engine.html" title="15.5 The ARCHIVE Storage Engine"><code class="literal">ARCHIVE</code></a> storage engines support
        spatial columns such as <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/spatial-type-overview.html" title="11.5.1 Spatial Data Types"><code class="literal">POINT</code></a> and
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/spatial-type-overview.html" title="11.5.1 Spatial Data Types"><code class="literal">GEOMETRY</code></a>.
        (<a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/spatial-types.html" title="11.5 Spatial Data Types">Section&nbsp;11.5, “Spatial Data Types”</a>, describes the spatial data
        types.) However, support for spatial column indexing varies
        among engines. Spatial and nonspatial indexes on spatial columns
        are available according to the following rules.
      </p><p>
        Spatial indexes on spatial columns (created using
        <code class="literal">SPATIAL INDEX</code>) have these characteristics:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Available only for <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html" title="15.2 The MyISAM Storage Engine"><code class="literal">MyISAM</code></a> and
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> tables. Specifying
            <code class="literal">SPATIAL INDEX</code> for other storage engines
            results in an error.
          </p></li><li class="listitem"><p>
            Indexed columns must be <code class="literal">NOT NULL</code>.
          </p></li><li class="listitem"><p>
            Column prefix lengths are prohibited. The full width of each
            column is indexed.
</p></li></ul>
</div>
<p>
        Nonspatial indexes on spatial columns (created with
        <code class="literal">INDEX</code>, <code class="literal">UNIQUE</code>, or
        <code class="literal">PRIMARY KEY</code>) have these characteristics:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Permitted for any storage engine that supports spatial
            columns except <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/archive-storage-engine.html" title="15.5 The ARCHIVE Storage Engine"><code class="literal">ARCHIVE</code></a>.
          </p></li><li class="listitem"><p>
            Columns can be <code class="literal">NULL</code> unless the index is a
            primary key.
          </p></li><li class="listitem"><p>
            For each spatial column in a non-<code class="literal">SPATIAL</code>
            index except <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/spatial-type-overview.html" title="11.5.1 Spatial Data Types"><code class="literal">POINT</code></a> columns, a
            column prefix length must be specified. (This is the same
            requirement as for indexed
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/blob.html" title="11.4.3 The BLOB and TEXT Types"><code class="literal">BLOB</code></a> columns.) The prefix
            length is given in bytes.
          </p></li><li class="listitem"><p>
            The index type for a non-<code class="literal">SPATIAL</code> index
            depends on the storage engine. Currently, B-tree is used.
          </p></li><li class="listitem"><p>
            Permitted for a column that can have <code class="literal">NULL</code>
            values only for <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a>,
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html" title="15.2 The MyISAM Storage Engine"><code class="literal">MyISAM</code></a>, and
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html" title="15.3 The MEMORY Storage Engine"><code class="literal">MEMORY</code></a> tables.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="create-index-options"></a>Index Options</h4>

</div>

</div>

</div>
<p>
        Following the key part list, index options can be given. An
        <em class="replaceable"><code>index_option</code></em> value can be any of the
        following:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">KEY_BLOCK_SIZE [=]
            <em class="replaceable"><code>value</code></em></code>
          </p><p>
            For <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html" title="15.2 The MyISAM Storage Engine"><code class="literal">MyISAM</code></a> tables,
            <code class="literal">KEY_BLOCK_SIZE</code> optionally specifies the
            size in bytes to use for index key blocks. The value is
            treated as a hint; a different size could be used if
            necessary. A <code class="literal">KEY_BLOCK_SIZE</code> value
            specified for an individual index definition overrides a
            table-level <code class="literal">KEY_BLOCK_SIZE</code> value.
          </p><p>
            <code class="literal">KEY_BLOCK_SIZE</code> is not supported at the
            index level for <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> tables.
            See <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-table.html" title="13.1.18 CREATE TABLE Syntax">Section&nbsp;13.1.18, “CREATE TABLE Syntax”</a>.
          </p></li><li class="listitem"><p>
            <em class="replaceable"><code>index_type</code></em>
          </p><p>
            Some storage engines permit you to specify an index type
            when creating an index. For example:
          </p><div class="copytoclipboard-wrapper" style="position: relative;"><pre class="programlisting line-numbers  language-sql"><div class="docs-select-all right" id="sa23960674"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class=" language-sql"><span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> lookup <span class="token punctuation">(</span>id <span class="token datatype">INT</span><span class="token punctuation">)</span> <span class="token keyword">ENGINE</span> <span class="token operator">=</span> <span class="token keyword">MEMORY</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">INDEX</span> id_index <span class="token keyword">ON</span> lookup <span class="token punctuation">(</span>id<span class="token punctuation">)</span> <span class="token keyword">USING</span> <span class="token keyword">BTREE</span><span class="token punctuation">;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre></div><p>
            <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html#create-index-storage-engine-index-types" title="Table 13.1 Index Types Per Storage Engine">Table&nbsp;13.1, “Index Types Per Storage Engine”</a>
            shows the permissible index type values supported by
            different storage engines. Where multiple index types are
            listed, the first one is the default when no index type
            specifier is given. Storage engines not listed in the table
            do not support an <em class="replaceable"><code>index_type</code></em>
            clause in index definitions.
</p>
<div class="table">
<a name="create-index-storage-engine-index-types"></a><p class="title"><b>Table&nbsp;13.1&nbsp;Index Types Per Storage Engine</b></p>
<div class="table-contents">
<table summary="Permissible index types by storage engine."><colgroup><col width="20%"><col width="50%"></colgroup><thead><tr>
                <th scope="col">Storage Engine</th>
                <th scope="col">Permissible Index Types</th>
              </tr></thead><tbody><tr>
                <td scope="row"><a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a></td>
                <td><code class="literal">BTREE</code></td>
              </tr><tr>
                <td scope="row"><a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html" title="15.2 The MyISAM Storage Engine"><code class="literal">MyISAM</code></a></td>
                <td><code class="literal">BTREE</code></td>
              </tr><tr>
                <td scope="row"><a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html" title="15.3 The MEMORY Storage Engine"><code class="literal">MEMORY</code></a>/<code class="literal">HEAP</code></td>
                <td><code class="literal">HASH</code>, <code class="literal">BTREE</code></td>
              </tr><tr>
                <td scope="row"><a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a></td>
                <td><code class="literal">HASH</code>, <code class="literal">BTREE</code> (see note in text)</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
            The <em class="replaceable"><code>index_type</code></em> clause cannot be
            used for <code class="literal">FULLTEXT INDEX</code> or
            <code class="literal">SPATIAL INDEX</code> specifications. Full-text
            index implementation is storage engine dependent. Spatial
            indexes are implemented as R-tree indexes.
          </p><p>
            <code class="literal">BTREE</code> indexes are implemented by the
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> storage engine as T-tree
            indexes.
</p><a class="indexterm" name="idm139976444070096"></a><a class="indexterm" name="idm139976444068608"></a>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              For indexes on <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> table
              columns, the <code class="literal">USING</code> option can be
              specified only for a unique index or primary key.
              <code class="literal">USING HASH</code> prevents the creation of an
              ordered index; otherwise, creating a unique index or
              primary key on an <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> table
              automatically results in the creation of both an ordered
              index and a hash index, each of which indexes the same set
              of columns.
            </p><p>
              For unique indexes that include one or more
              <code class="literal">NULL</code> columns of an
              <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> table, the hash index can
              be used only to look up literal values, which means that
              <code class="literal">IS [NOT] NULL</code> conditions require a full
              scan of the table. One workaround is to make sure that a
              unique index using one or more <code class="literal">NULL</code>
              columns on such a table is always created in such a way
              that it includes the ordered index; that is, avoid
              employing <code class="literal">USING HASH</code> when creating the
              index.
</p>
</div>
<p>
            If you specify an index type that is not valid for a given
            storage engine, but another index type is available that the
            engine can use without affecting query results, the engine
            uses the available type. The parser recognizes
            <code class="literal">RTREE</code> as a type name, but currently this
            cannot be specified for any storage engine.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              Use of the <em class="replaceable"><code>index_type</code></em> option
              before the <code class="literal">ON
              <em class="replaceable"><code>tbl_name</code></em></code> clause is
              deprecated; support for use of the option in this position
              will be removed in a future MySQL release. If an
              <em class="replaceable"><code>index_type</code></em> option is given in
              both the earlier and later positions, the final option
              applies.
</p>
</div>
<p>
            <code class="literal">TYPE <em class="replaceable"><code>type_name</code></em></code>
            is recognized as a synonym for <code class="literal">USING
            <em class="replaceable"><code>type_name</code></em></code>. However,
            <code class="literal">USING</code> is the preferred form.
          </p><p>
            The following tables show index characteristics for the
            storage engines that support the
            <em class="replaceable"><code>index_type</code></em> option.
</p>
<div class="table">
<a name="innodb-storage-engine-index-characteristics"></a><p class="title"><b>Table&nbsp;13.2&nbsp;InnoDB Storage Engine Index Characteristics</b></p>
<div class="table-contents">
<table summary="Index characteristics of the InnoDB storage engine."><colgroup><col width="15%"><col width="10%"><col width="15%"><col width="20%"><col width="20%"><col width="20%"></colgroup><thead><tr>
                <th scope="col">Index Class</th>
                <th scope="col">Index Type</th>
                <th scope="col">Stores NULL VALUES</th>
                <th scope="col">Permits Multiple NULL Values</th>
                <th scope="col">IS NULL Scan Type</th>
                <th scope="col">IS NOT NULL Scan Type</th>
              </tr></thead><tbody><tr>
                <td scope="row">Primary key</td>
                <td><code class="literal">BTREE</code></td>
                <td>No</td>
                <td>No</td>
                <td>N/A</td>
                <td>N/A</td>
              </tr><tr>
                <td scope="row">Unique</td>
                <td><code class="literal">BTREE</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row">Key</td>
                <td><code class="literal">BTREE</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row"><code class="literal">FULLTEXT</code></td>
                <td>N/A</td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Table</td>
                <td>Table</td>
              </tr><tr>
                <td scope="row"><code class="literal">SPATIAL</code></td>
                <td>N/A</td>
                <td>No</td>
                <td>No</td>
                <td>N/A</td>
                <td>N/A</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="table">
<a name="myisam-storage-engine-index-characteristics"></a><p class="title"><b>Table&nbsp;13.3&nbsp;MyISAM Storage Engine Index Characteristics</b></p>
<div class="table-contents">
<table summary="Index characteristics of the MyISAM storage engine."><colgroup><col width="15%"><col width="10%"><col width="15%"><col width="20%"><col width="20%"><col width="20%"></colgroup><thead><tr>
                <th scope="col">Index Class</th>
                <th scope="col">Index Type</th>
                <th scope="col">Stores NULL VALUES</th>
                <th scope="col">Permits Multiple NULL Values</th>
                <th scope="col">IS NULL Scan Type</th>
                <th scope="col">IS NOT NULL Scan Type</th>
              </tr></thead><tbody><tr>
                <td scope="row">Primary key</td>
                <td><code class="literal">BTREE</code></td>
                <td>No</td>
                <td>No</td>
                <td>N/A</td>
                <td>N/A</td>
              </tr><tr>
                <td scope="row">Unique</td>
                <td><code class="literal">BTREE</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row">Key</td>
                <td><code class="literal">BTREE</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row"><code class="literal">FULLTEXT</code></td>
                <td>N/A</td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Table</td>
                <td>Table</td>
              </tr><tr>
                <td scope="row"><code class="literal">SPATIAL</code></td>
                <td>N/A</td>
                <td>No</td>
                <td>No</td>
                <td>N/A</td>
                <td>N/A</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="table">
<a name="memory-storage-engine-index-characteristics"></a><p class="title"><b>Table&nbsp;13.4&nbsp;MEMORY Storage Engine Index Characteristics</b></p>
<div class="table-contents">
<table summary="Index characteristics of the Memory storage engine."><colgroup><col width="15%"><col width="10%"><col width="15%"><col width="20%"><col width="20%"><col width="20%"></colgroup><thead><tr>
                <th scope="col">Index Class</th>
                <th scope="col">Index Type</th>
                <th scope="col">Stores NULL VALUES</th>
                <th scope="col">Permits Multiple NULL Values</th>
                <th scope="col">IS NULL Scan Type</th>
                <th scope="col">IS NOT NULL Scan Type</th>
              </tr></thead><tbody><tr>
                <td scope="row">Primary key</td>
                <td><code class="literal">BTREE</code></td>
                <td>No</td>
                <td>No</td>
                <td>N/A</td>
                <td>N/A</td>
              </tr><tr>
                <td scope="row">Unique</td>
                <td><code class="literal">BTREE</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row">Key</td>
                <td><code class="literal">BTREE</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row">Primary key</td>
                <td><code class="literal">HASH</code></td>
                <td>No</td>
                <td>No</td>
                <td>N/A</td>
                <td>N/A</td>
              </tr><tr>
                <td scope="row">Unique</td>
                <td><code class="literal">HASH</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row">Key</td>
                <td><code class="literal">HASH</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="table">
<a name="ndb-storage-engine-index-characteristics"></a><p class="title"><b>Table&nbsp;13.5&nbsp;NDB Storage Engine Index Characteristics</b></p>
<div class="table-contents">
<table summary="Index characteristics of the NDB storage engine."><colgroup><col width="15%"><col width="10%"><col width="15%"><col width="20%"><col width="20%"><col width="20%"></colgroup><thead><tr>
                <th scope="col">Index Class</th>
                <th scope="col">Index Type</th>
                <th scope="col">Stores NULL VALUES</th>
                <th scope="col">Permits Multiple NULL Values</th>
                <th scope="col">IS NULL Scan Type</th>
                <th scope="col">IS NOT NULL Scan Type</th>
              </tr></thead><tbody><tr>
                <td scope="row">Primary key</td>
                <td><code class="literal">BTREE</code></td>
                <td>No</td>
                <td>No</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row">Unique</td>
                <td><code class="literal">BTREE</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row">Key</td>
                <td><code class="literal">BTREE</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Index</td>
                <td>Index</td>
              </tr><tr>
                <td scope="row">Primary key</td>
                <td><code class="literal">HASH</code></td>
                <td>No</td>
                <td>No</td>
                <td>Table (see note 1)</td>
                <td>Table (see note 1)</td>
              </tr><tr>
                <td scope="row">Unique</td>
                <td><code class="literal">HASH</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Table (see note 1)</td>
                <td>Table (see note 1)</td>
              </tr><tr>
                <td scope="row">Key</td>
                <td><code class="literal">HASH</code></td>
                <td>Yes</td>
                <td>Yes</td>
                <td>Table (see note 1)</td>
                <td>Table (see note 1)</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
            Table note:
          </p><p>
            1. If <code class="literal">USING HASH</code> is specified that
            prevents creation of an implicit ordered index.
          </p></li><li class="listitem"><p>
            <code class="literal">WITH PARSER
            <em class="replaceable"><code>parser_name</code></em></code>
          </p><p>
            This option can be used only with
            <code class="literal">FULLTEXT</code> indexes. It associates a parser
            plugin with the index if full-text indexing and searching
            operations need special handling.
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> and
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html" title="15.2 The MyISAM Storage Engine"><code class="literal">MyISAM</code></a> support full-text parser
            plugins. See <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/plugin-types.html#full-text-plugin-type" title="Full-Text Parser Plugins">Full-Text Parser Plugins</a> and
            <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/writing-full-text-plugins.html" title="28.2.4.4 Writing Full-Text Parser Plugins">Section&nbsp;28.2.4.4, “Writing Full-Text Parser Plugins”</a> for more
            information.
          </p></li><li class="listitem"><p>
            <code class="literal">COMMENT
            '<em class="replaceable"><code>string</code></em>'</code>
          </p><p>
            Index definitions can include an optional comment of up to
            1024 characters.
          </p><p>
            The
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/index-page-merge-threshold.html" title="14.6.13 Configuring the Merge Threshold for Index Pages"><code class="literal">MERGE_THRESHOLD</code></a>
            for index pages can be configured for individual indexes
            using the <em class="replaceable"><code>index_option</code></em>
            <code class="literal">COMMENT</code> clause of the
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" title="13.1.14 CREATE INDEX Syntax"><code class="literal">CREATE INDEX</code></a> statement. For
            example:
          </p><div class="copytoclipboard-wrapper" style="position: relative;"><pre class="programlisting line-numbers  language-sql"><div class="docs-select-all right" id="sa31510197" style="display: none;"><div class="copy-help left" style="display: none;">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class=" language-sql"><span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>id <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">INDEX</span> id_index <span class="token keyword">ON</span> t1 <span class="token punctuation">(</span>id<span class="token punctuation">)</span> <span class="token keyword">COMMENT</span> <span class="token string">'MERGE_THRESHOLD=40'</span><span class="token punctuation">;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre></div><p>
            If the page-full percentage for an index page falls below
            the <code class="literal">MERGE_THRESHOLD</code> value when a row is
            deleted or when a row is shortened by an update operation,
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> attempts to merge the
            index page with a neighboring index page. The default
            <code class="literal">MERGE_THRESHOLD</code> value is 50, which is the
            previously hardcoded value.
          </p><p>
            <code class="literal">MERGE_THRESHOLD</code> can also be defined at
            the index level and table level using
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/create-table.html" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE</code></a> and
            <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/alter-table.html" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a> statements. For
            more information, see
            <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/index-page-merge-threshold.html" title="14.6.13 Configuring the Merge Threshold for Index Pages">Section&nbsp;14.6.13, “Configuring the Merge Threshold for Index Pages”</a>.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="create-index-copying"></a>Table Copying and Locking Options</h4>

</div>

</div>

</div>
<p>
        <code class="literal">ALGORITHM</code> and <code class="literal">LOCK</code> clauses
        may be given to influence the table copying method and level of
        concurrency for reading and writing the table while its indexes
        are being modified. They have the same meaning as for the
        <a class="link" href="https://dev.mysql.com/doc/refman/5.7/en/alter-table.html" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a> statement. For more
        information, see <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/alter-table.html" title="13.1.8 ALTER TABLE Syntax">Section&nbsp;13.1.8, “ALTER TABLE Syntax”</a>
      </p><p>
        NDB Cluster formerly supported online <code class="literal">CREATE
        INDEX</code> operations using an alternative syntax that is
        no longer supported. NDB Cluster now supports online operations
        using the same <code class="literal">ALGORITHM=INPLACE</code> syntax used
        with the standard MySQL Server. See
        <a class="xref" href="https://dev.mysql.com/doc/refman/5.7/en/alter-table-online-operations.html" title="13.1.8.2 ALTER TABLE Online Operations in NDB Cluster">Section&nbsp;13.1.8.2, “ALTER TABLE Online Operations in NDB Cluster”</a>, for more
        information.
</p>
</div>

</div>
<br>
        </div>

                <div id="docs-in-page-nav-container">
            <div id="docs-in-page-nav">
                
    <a href="https://dev.mysql.com/doc/refman/5.7/en/create-function.html" aria-label="Previous" title="Previous: CREATE FUNCTION Syntax"><span class="icon-chevron-left"></span> PREV</a> &nbsp;
<a href="https://dev.mysql.com/doc/refman/5.7/en/index.html" aria-label="Start" title="Start"> HOME</a> &nbsp;
        <a aria-label="Up" href="https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-definition.html" title="Up: Data Definition Statements"> UP</a> &nbsp;
    <a href="https://dev.mysql.com/doc/refman/5.7/en/create-logfile-group.html" aria-label="Next" title="Next: CREATE LOGFILE GROUP Syntax">NEXT <span class="icon-chevron-right"></span></a>
            </div>
        </div>
        
         <div id="docs-body-extra">
             
<a class="docs-sidebar-section" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-related"></span>
    <span class="text">Related Documentation</span></a>
<div class="docs-sidebar-accordian">
    <div class="text">
        <a href="https://dev.mysql.com/doc/relnotes/mysql/5.7/en/">MySQL 5.7 Release Notes</a><br>
        </div>
</div>

    <a class="docs-sidebar-section" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-download-thin"></span>
        <span class="text">
            Download
                            this Manual
                    </span>
    </a>
    <div class="docs-sidebar-accordian">
        <div class="text">
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.pdf">PDF (US Ltr)</a>
            - 38.9Mb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.a4.pdf">PDF (A4)</a>
            - 39.0Mb<br>
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-5.7-en-pdf-1-20181013.noarch.rpm">PDF (RPM)</a>
            - 38.0Mb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.html-chapter.tar.gz">HTML Download (TGZ)</a>
            - 10.8Mb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.html-chapter.zip">HTML Download (Zip)</a>
            - 10.8Mb<br>
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-5.7-en-html-chapter-1-20181013.noarch.rpm">HTML Download (RPM)</a>
            - 9.5Mb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.man-gpl.tar.gz">Man Pages (TGZ)</a>
            - 211.0Kb<br>
                        <a href="https://downloads.mysql.com/docs/refman-5.7-en.man-gpl.zip">Man Pages (Zip)</a>
            - 320.0Kb<br>
                        <a href="https://downloads.mysql.com/docs/mysql-5.7.info.gz">Info (Gzip)</a>
            - 3.5Mb<br>
                        <a href="https://downloads.mysql.com/docs/mysql-5.7.info.zip">Info (Zip)</a>
            - 3.5Mb<br>
                    </div>
    </div>

<a class="docs-sidebar-section" href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html"><span class="icon-book"></span>
    <span class="text">Excerpts from this Manual</span></a>
<div class="docs-sidebar-accordian">
    <div class="text">
                <a href="https://dev.mysql.com/doc/mysql-backup-excerpt/5.7/en/">MySQL Backup and Recovery</a><br>
                <a href="https://dev.mysql.com/doc/mysql-g11n-excerpt/5.7/en/">MySQL Globalization</a><br>
                <a href="https://dev.mysql.com/doc/mysql-infoschema-excerpt/5.7/en/">MySQL Information Schema</a><br>
                <a href="https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/">MySQL Installation Guide</a><br>
                <a href="https://dev.mysql.com/doc/mysql-linuxunix-excerpt/5.7/en/">MySQL and Linux/Unix</a><br>
                <a href="https://dev.mysql.com/doc/mysql-osx-excerpt/5.7/en/">MySQL and OS X</a><br>
                <a href="https://dev.mysql.com/doc/mysql-partitioning-excerpt/5.7/en/">MySQL Partitioning</a><br>
                <a href="https://dev.mysql.com/doc/mysql-perfschema-excerpt/5.7/en/">MySQL Performance Schema</a><br>
                <a href="https://dev.mysql.com/doc/mysql-replication-excerpt/5.7/en/">MySQL Replication</a><br>
                <a href="https://dev.mysql.com/doc/mysql-repo-excerpt/5.7/en/">Using the MySQL Yum Repository</a><br>
                <a href="https://dev.mysql.com/doc/mysql-reslimits-excerpt/5.7/en/">MySQL Restrictions and Limitations</a><br>
                <a href="https://dev.mysql.com/doc/mysql-security-excerpt/5.7/en/">Security in MySQL</a><br>
                <a href="https://dev.mysql.com/doc/mysql-solaris-excerpt/5.7/en/">MySQL and Solaris</a><br>
                <a href="https://dev.mysql.com/doc/mysql-sourcebuild-excerpt/5.7/en/">Building MySQL from Source</a><br>
                <a href="https://dev.mysql.com/doc/mysql-startstop-excerpt/5.7/en/">Starting and Stopping MySQL</a><br>
                <a href="https://dev.mysql.com/doc/mysql-tutorial-excerpt/5.7/en/">MySQL Tutorial</a><br>
                <a href="https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/">MySQL and Windows</a><br>
                <a href="https://dev.mysql.com/doc/mysql-cluster-excerpt/5.7/en/">MySQL NDB Cluster 7.5</a><br>
                <a href="https://dev.mysql.com/doc/mysql-secure-deployment-guide/5.7/en/">MySQL Secure Deployment Guide</a><br>
            </div>
</div>
         </div>

                     
<div id="docs-comments">
    <div class="docs-comments-header"><span class="icon-bubbles"></span> User Comments</div>

    <div class="docs-comments-disclaimer">
        User comments in this section are, as the name implies, provided by MySQL users.
        The MySQL documentation team is not responsible for, nor do they endorse, any of
        the information provided here.
    </div>

    <div id="comment-listing">
    
                    <div class="docs-comment-item" id="c11915">
            <div class="docs-comment-item-header">
                                <span class="icon-chatbubble"></span> &nbsp;
                Posted by
                <span class="docs-comment-name">
                                    Lincoln Rickwood
                                </span>
                on
                June 24, 2011
                                </div>
                            <div class="docs-comment-item-edit"></div>
                <div class="docs-comment-item-text">
                    Here's an alternative stored procedure (Sorry about the lack of indentation, the comment box seems to strip leading spaces)...<br><br>delimiter //<br>drop procedure if exists AddTableIndex //<br>create procedure AddTableIndex<br>  ( in schemaName       varchar(128)  -- If null use name of current schema;<br>  , in tableName        varchar(128)  -- If null an exception will be thrown.<br>  , in indexName        varchar(128)  -- If null an exception will be thrown.<br>  , in indexDefinition  varchar(1024) -- E.g. '(expireTS_ ASC)'<br>  , in ifPresent        enum('leaveUnchanged', 'dropAndReplace') -- null=leaveUnchanged.<br>  , out outcome         tinyint(1)    -- 0=unchanged, 1=replaced, 4=added.<br>  )<br>begin<br>  declare doDrop   tinyint(1)    default null;<br>  declare doAdd    tinyint(1)    default null;<br>  declare tmpSql   varchar(4096) default '';<br><br>  set schemaName = coalesce(schemaName, schema());<br>  set ifPresent  = coalesce(ifPresent, 'leaveUnchanged');<br>  if exists<br>    (SELECT *<br>       FROM INFORMATION_SCHEMA.STATISTICS<br>       WHERE table_schema = schemaName<br>         AND table_name   = tableName<br>         AND index_name   = indexName<br>    )<br>  then<br>    if (ifPresent = 'leaveUnchanged')<br>    then<br>      set doDrop   = 0;<br>      set doAdd    = 0;<br>      set outcome  = 0;<br>    elseif (ifPresent = 'dropAndReplace')<br>    then<br>      set doDrop   = 1;<br>      set doAdd    = 1;<br>      set outcome  = 1;<br>    end if;<br>  else<br>    set doDrop   = 0;<br>    set doAdd    = 1;<br>    set outcome  = 4;<br>  end if;<br><br>  if (doDrop = 1)<br>  then<br>    set tmpSql = concat( 'alter table `', schemaName, '`.`', tableName, '` drop index `', indexName, '` ');<br>    set @sql = tmpSql;<br>    prepare tmp_stmt from @sql;<br>    execute tmp_stmt;<br>    deallocate prepare tmp_stmt;<br>  end if;<br><br>  if (doAdd = 1)<br>  then<br>    set tmpSql = concat( 'alter table `', schemaName, '`.`', tableName, '` add index `', indexName, '` ', indexDefinition);<br>    set @sql = tmpSql;<br>    prepare tmp_stmt from @sql;<br>    execute tmp_stmt;<br>    deallocate prepare tmp_stmt;<br>  end if;<br><br>end; //<br><br>
                </div>
                    </div>
                            <div class="docs-comment-item" id="c12640">
            <div class="docs-comment-item-header">
                                <span class="icon-chatbubble"></span> &nbsp;
                Posted by
                <span class="docs-comment-name">
                                    James Greene
                                </span>
                on
                May 3, 2013
                                </div>
                            <div class="docs-comment-item-edit"></div>
                <div class="docs-comment-item-text">
                    OK, so I'm a bit green myself when it comes to optimizing MySQL.  So, I'm giving this little bit of advice to the other newbs out there:<br><br>Indexing a LARGE amount of data, this can take hours.  Thankfully, I used on a test database.  Please be careful, if you plan on adding index on a production database.  :-/<br>
                </div>
                    </div>
                            <div class="docs-comment-item" id="c14605">
            <div class="docs-comment-item-header">
                                <span class="icon-chatbubble"></span> &nbsp;
                Posted by
                <span class="docs-comment-name">
                                    Sebastian Lechner
                                </span>
                on
                December 8, 2016
                                </div>
                            <div class="docs-comment-item-edit"></div>
                <div class="docs-comment-item-text">
                    If you set an index on a big char or varchar field which is utf8mb4 encoded, you have to divide the max index prefix length of 767 bytes by 4 resulting in 191. This is because the maximum length of a utf8mb4 character is four bytes. For a utf8 character it would be three bytes resulting in max index prefix length of 254.<br><br>eg:<br><br>CREATE TABLE `my_table` (<br>  `field1` varchar(400) CHARACTER SET utf8mb4,<br>  KEY `idx_my_table_field1` (`field1`(191))<br>);<br>
                </div>
                    </div>
                </div>

        <div class="docs-comment-disclaimer">
        <a href="https://dev.mysql.com/auth/register/?dest=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Fcreate-index.html%3Facf%3D1%23add-comment" class="docs-comment-btn right">Sign Up</a>
        <a href="https://dev.mysql.com/auth/login/?dest=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Fcreate-index.html%3Facf%3D1%23add-comment" class="docs-comment-btn right">Login</a>
        You must be logged in to post a comment.
    </div>
    </div>
              </div>
     </div>

</div>

<script>
$(function() {
    var doc = new $.doc({ 'mobile': $.browser.mobile, 'docId': 1, 'highlight': true });
});
</script>
    

            
        </div>
    </div>

    <footer class="collapsed">
        <div id="footer-bottom">
                                    <div id="footer-collapse">
                <a href="https://dev.mysql.com/doc/refman/5.7/en/create-index.html" id="expand-footer" aria-label="Expand Footer" title="Expand Footer"><span class="icon-plus-square"></span></a>
            </div>
                        <div class="footer-contact">
                <div id="footer-contact-icon" style="display: none;">
                    <span class="icon-call-phone"></span>
                </div>
                <div id="footer-contact-numbers" style="display: none;">
                    <strong>Contact MySQL Sales</strong><br>
                    USA/Canada: +1-866-221-0634 &nbsp;
                    (<a href="https://www.mysql.com/about/contact/phone/">More Countries »</a>)
                </div>
                <div id="footer-contact-copyright" style="display: inline-block;">
                    <a href="http://www.oracle.com/" aria-label="Oracle" title="Oracle"><span class="oracle-logo"></span></a>
                    &nbsp; © 2018, Oracle Corporation and/or its affiliates
                </div>
            </div>
            <div class="social-icons">
                <a aria-label="Join us on Facebook" title="Join us on Facebook" href="http://www.facebook.com/mysql"><span class="icon-facebook-square"></span></a>
                <a aria-label="Follow us on Twitter" title="Follow us on Twitter" href="https://twitter.com/mysql"><span class="icon-twitter-square"></span></a>
                <a aria-label="Follow us on LinkedIn" title="Follow us on LinkedIn" href="https://www.linkedin.com/company/mysql"><span class="icon-linkedin-square"></span></a>
                <a aria-label="Join Google+ to follow MySQL" title="Join Google+ to follow MySQL" href="https://plus.google.com/+mysql"><span class="icon-google-plus-square"></span></a>
                <a aria-label="Visit our YouTube channel" title="Visit our YouTube channel" href="http://www.youtube.com/mysqlchannel"><span class="icon-youtube-square"></span></a>
            </div>
            <br class="clear">
        </div>
        <div id="footer-links">

            <div id="footer-nav"></div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://www.mysql.com/products/">Products</a></li>
                    <li><a href="https://www.mysql.com/cloud/">Oracle MySQL Cloud Service</a></li>
                    <li><a href="https://www.mysql.com/products/enterprise/">MySQL Enterprise Edition</a></li>
                    <li><a href="https://www.mysql.com/products/standard/">MySQL Standard Edition</a></li>
                    <li><a href="https://www.mysql.com/products/classic/">MySQL Classic Edition</a></li>
                    <li><a href="https://www.mysql.com/products/cluster/">MySQL Cluster CGE</a></li>
                    <li><a href="https://www.mysql.com/oem/">MySQL Embedded (OEM/ISV)</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://www.mysql.com/services/">Services</a></li>
                    <li><a href="https://www.mysql.com/training/">Training</a></li>
                    <li><a href="https://www.mysql.com/certification/">Certification</a></li>
                    <li><a href="https://www.mysql.com/consulting/">Consulting</a></li>
                    <li><a href="https://www.mysql.com/support/">Support</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://dev.mysql.com/downloads/">Downloads</a></li>
                    <li><a href="https://dev.mysql.com/downloads/mysql/">MySQL Community Server</a></li>
                    <li><a href="https://dev.mysql.com/downloads/cluster/">MySQL NDB Cluster</a></li>
                    <li><a href="https://dev.mysql.com/downloads/shell/">MySQL Shell</a></li>
                    <li><a href="https://dev.mysql.com/downloads/router/">MySQL Router</a></li>
                    <li><a href="https://dev.mysql.com/downloads/workbench/">MySQL Workbench</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://dev.mysql.com/doc/">Documentation</a></li>
                    <li><a href="https://dev.mysql.com/doc/refman/en/">MySQL Reference Manual</a></li>
                    <li><a href="https://dev.mysql.com/doc/workbench/en/">MySQL Workbench</a></li>
                    <li><a href="https://dev.mysql.com/doc/index-cluster.html">MySQL NDB Cluster</a></li>
                    <li><a href="https://dev.mysql.com/doc/index-connectors.html">MySQL Connectors</a></li>
                    <li><a href="https://dev.mysql.com/doc/#topic">Topic Guides</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://www.mysql.com/about/">About MySQL</a></li>
                    <li><a href="https://www.mysql.com/about/contact/">Contact Us</a></li>
                                                            <li><a href="https://www.mysql.com/buy-mysql/">How to Buy</a></li>
                    <li><a href="https://www.mysql.com/partners/">Partners</a></li>
                    <li><a href="https://www.mysql.com/about/jobs/">Job Opportunities</a></li>
                    <li><a href="https://www.mysql.com/sitemap.html">Site Map</a></li>
                </ul>
            </div>

            
            <div id="footer-logo">
                <a href="http://www.oracle.com/" aria-label="Oracle" title="Oracle"><span class="oracle-logo"></span></a>
                &nbsp; © 2018, Oracle Corporation and/or its affiliates
                <div class="footer-legal-links">
                    <a href="https://www.mysql.com/about/legal/">Legal Policies</a> |
                    <a href="http://www.oracle.com/us/legal/privacy/index.htm">Your Privacy Rights</a> |
                    <a href="http://www.oracle.com/us/legal/terms/index.html">Terms of Use</a> |
                    <a href="http://www.oracle.com/us/legal/third-party-trademarks/index.html">Trademark Policy</a> |
                    <a href="http://www.oracle.com/technetwork/community/oca-486395.html">Contributor Agreement</a> |
                    <div id="teconsent" style="display: inline-block" consent="undefined"><script async="async" type="text/javascript" src="./28_files/notice" crossorigin="" id="truste_0.2627697215133378"></script><script async="async" type="text/javascript" crossorigin="" src="./28_files/1.12"></script><a id="icon-id041788309957610714" tabindex="0" role="button" lang="en" style="cursor: pointer;">Cookie Preferences</a></div>
                </div>
            </div>

        </div>
    </footer>
</div>

        <script src="./28_files/s_code_remote.js"></script><script type="text/javascript" src="./28_files/metrics_group1.js"></script>

        



</body></html>